package org.zjx.account.enums;

import lombok.Getter;
import org.zjx.common.entity.Address;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Getter
public enum Sects {
    HUA_GUO_SHAN("花果山", new Address("幻境花果山", 98, 82), "齐天大圣", Collections.singletonList(new Address("幻境花果山", 90, 105)), new Address("花果山", 63, 91)),
    LONG_GONG("龙宫", new Address("龙宫", 72, 36), "东海龙王", Collections.singletonList(new Address("水晶宫", 38, 19)), new Address("龙宫", 96, 48)),
    NV_ER_CUN("女儿村", new Address("女儿村", 30, 86), "孙婆婆", Collections.singletonList(new Address("女儿村村长家", 26, 17)), new Address("女儿村", 22, 113)),
    TIAN_GONG("天宫", new Address("天宫", 215, 25), "李靖", Collections.singletonList(new Address("凌霄宝殿", 25, 32)), new Address("天宫", 160, 54)),
    HUA_SHENG_SI("化生寺", new Address("化生寺", 22, 14), "空度禅师", Collections.singletonList(new Address("藏经阁", 16, 16)), new Address("化生寺", 50, 29)),
    MO_WANG_ZHAI("魔王寨", new Address("魔王寨", 81, 37), "牛魔王", Collections.singletonList(new Address("魔王居", 78, 61)), new Address("魔王寨", 24, 13)),
    SHEN_MU_LIN("神木林", new Address("神木林", 45, 49), "巫奎虎", Collections.singletonList(new Address("神木屋", 31, 19)), new Address("神木林", 51, 69)),
    WU_DI_DONG("无底洞", new Address("无底洞", 18, 64), "地涌夫人", Collections.singletonList(new Address("琉璃殿", 47, 30)), new Address("无底洞", 61, 64)),
    LING_BO_CHENG("凌波城", new Address("凌波城", 47, 95), "二郎神", Collections.singletonList(new Address("凌波城", 70, 123)), new Address("凌波城", 33, 84)),
    TIAN_JI_CHENG("天机城", new Address("天机城", 106, 98), "小夫子", Collections.singletonList(new Address("天机堂", 58, 24)), new Address("天机城", 119, 103)),
    PU_TUO_SHAN("普陀山", new Address("普陀山", 13, 57), "观音姐姐", Collections.singletonList(new Address("潮音洞", 12, 36)), new Address("普陀山", 8, 61)),
    SHI_TUO_LING("狮驼岭", new Address("狮驼岭", 58, 6), "大大王", Collections.singletonList(new Address("狮王洞", 28, 19)), new Address("狮驼岭", 120, 32)),
    DA_TANG_GUAN_FU("大唐官府", new Address("大唐官府", 132, 21), "程咬金", Collections.singletonList(new Address("程咬金府", 20, 17)), new Address("大唐官府", 97, 35)),
    NV_MEI_LAN("女魃墓", new Address("女魃墓", 50, 100), "天女魃", Collections.singletonList(new Address("忘忧宫", 42, 32)), new Address("女魃墓", 19, 108)),
    FANG_CUN_SHAN("方寸山", new Address("方寸山", 71, 106), "菩提祖师", Collections.singletonList(new Address("灵台宫", 46, 27)), new Address("方寸山", 70, 104)),
    YIN_CAO_DI_FU("阴曹地府", new Address("地府", 72, 33), "地藏王", Collections.singletonList(new Address("地藏王府", 28, 14)), new Address("地府", 34, 62)),
    PAN_SI_DONG("盘丝洞", new Address("盘丝岭", 188, 87), "冰冰姑娘", Collections.singletonList(new Address("盘丝洞", 33, 41)), new Address("盘丝岭", 180, 120)),
    WU_ZHUANG_GUAN("五庄观", new Address("五庄观", 10, 9), "镇元大仙", Collections.singletonList(new Address("乾坤殿", 24, 13)), new Address("五庄观", 40, 26));

    private final String name;
    private final Address f8Location;
    private final String masterName;
    private final List<Address> masterAddresses;
    private final Address brotherAddress;

    Sects(String name, Address f8Location, String masterName, List<Address> masterAddresses, Address brotherAddress) {
        this.name = name;
        this.f8Location = f8Location;
        this.masterName = masterName;
        this.masterAddresses = masterAddresses;
        this.brotherAddress = brotherAddress;
    }

    public static Sects fromName(String name) {
        for (Sects sects : values()) {
            if (sects.name.equals(name)) {
                return sects;
            }
        }
        throw new IllegalArgumentException("Unknown Sects: " + name);
    }
}